package com.example.controller;

import com.example.bean.Product;
import com.example.services.impl.ProductServicesImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {

    @Autowired
    private ProductServicesImpl productServices;

    @GetMapping("/products/{id}")
    public Product getProductById(@PathVariable Integer id) {
        return productServices.getProductById(id);
    }

}
